import request from '@/utils/request'

const docsFilesApi = {
    /**
     * 文件列表
     */
    lists(params: {
        page_no?: number;
        page_size?: number;
        status?: number;
        code?: string;
        name?: string;
        user?: string;
    }): Promise<any> {
        return request.get({
            url: '/apply/docs/files/lists',
            params
        })
    },

    /**
     * 文件数据
     */
    dataset(params: {
        page_no?: number,
        page_size?: number,
        file_id: number
    }): Promise<any> {
        return request.get({
            url: '/apply/docs/files/dataset',
            params
        })
    },

    /**
     * 文件删除
     */
    delete(id: number): Promise<any> {
        return request.post({
            url: '/apply/docs/files/delete',
            params: {
                id
            }
        })
    },

    /**
     * 文件重试
     */
    retry(id: number): Promise<any> {
        return request.post({
            url: '/apply/docs/files/retry',
            params: {
                id
            }
        })
    }
}

export default docsFilesApi
